using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using MSRI.HelperClasses;
using Instedd.Labs.Geo.Library.Kml;
using Instedd.Labs.Geo.Library.Sms;

namespace Instedd.Labs.Geo.Library.Tests
{
    /// <summary>
    /// Summary description for UnitTest1
    /// </summary>
    [TestClass]
    public class SmsExtensionFixture
    {
        public SmsExtensionFixture()
        {
        }

        [TestMethod]
        public void GetMessageIdAsStringReturnsTheSerializedGuid()
        {
            SmsExtension sms = new SmsExtension(new SmsClass(), null, null, null, null);
            sms.Sms.MessageID = new Guid("9d986da1-3a9e-4043-ad14-f1a7fc5c9e62");

            Assert.AreEqual(sms.GetMessageIdAsString(), "9d986da1-3a9e-4043-ad14-f1a7fc5c9e62");
        }

        [TestMethod]
        public void ReplyReturnsANewMessageWithTheSameNumberAndSenderName()
        {
            SmsExtension sms = new SmsExtension(new SmsClass("1150001234", "20.12*55.11*sms message text"), null, "sms message text", "Tom", "4444");

            SmsExtension answer = sms.Reply("LocalName","response");

            Assert.IsNotNull(answer);
            Assert.IsNotNull(answer.Sms.MessageID);
            Assert.AreNotEqual(answer.Sms.MessageID, sms.Sms.MessageID);
            Assert.AreEqual(answer.Sms.Number, "1150001234");
            Assert.AreEqual(answer.SenderName, "LocalName");
            Assert.AreEqual(answer.Message, "response");
            Assert.AreEqual(answer.AnsweredMessage, sms);
        }
    }
}
